<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">
    <title th:replace="${title}">header</title>
    <link rel="shortcut icon" href="../static/image/favicon.ico" th:href="@{/image/favicon.ico}"/>
    <link rel="stylesheet" href="../static/css/semantic.min.css" th:href="@{/css/semantic.min.css}">
    <link rel="stylesheet" href="../static/css/icon.min.css" th:href="@{/css/icon.min.css}">
    <link rel="stylesheet" href="../static/css/mine.css" th:href="@{/css/mine.css}">
</head>
<body>
<nav th:fragment="menu(n)" class="ui inverted attached segment mine-padded-tb-mini">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">望岳笔记 ≧◔◡◔≦</h2>
            <a href="#" th:href="@{/}" class="m-item item mine-mobile-hide" th:classappend="${n==1} ? 'active'"><i
                    class="home icon"></i> 首页</a>
            <a href="#" th:href="@{/types/}" class="m-item item mine-mobile-hide" th:classappend="${n==2} ? 'active'"><i
                    class="idea icon"></i> 分类</a>
            <a href="#" th:href="@{/tags/}" class="m-item item mine-mobile-hide" th:classappend="${n==3} ? 'active'"><i
                    class="tags icon"></i> 标签</a>
            <a href="#" th:href="@{/timeline/}" class="m-item item mine-mobile-hide"
               th:classappend="${n==4}?'active'"><i class="hourglass start icon"></i> 时间轴</a>
            <a href="#" th:href="@{/picture/}" class="m-item item mine-mobile-hide"
               th:classappend="${n==5}?'active'"><i class="images icon"></i> 照片墙</a>
            <a href="#" th:href="@{/self/}" class="m-item item mine-mobile-hide" th:classappend="${n==6} ? 'active'"><i
                    class="info icon"></i> 关于我</a>
            <div class="m-item right item mine-mobile-hide">
                <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                    <div class="ui icon inverted input">
                        <input type="text" name="query" th:text="${query}" placeholder="搜索......">
                        <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <a href="#" onclick="$('.m-item').toggleClass('mine-mobile-hide');"
       class="ui menu toggle black icon button mine-right-top mine-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>

<div th:fragment="comment(comments)" th:each="comment : ${comments}" class="comment">
    <a class="avatar">
        <img src="#" th:src="@{${comment.avatar}}">
    </a>
    <div class="content">
        <span th:text="${comment.nickName}">Matt</span>
        <div class="metadata">
            <span class="date" th:text="${#dates.format(comment.updateTime,'yyyy-MM-dd hh:mm:ss')}">今天下午 5:42</span>
            <span class="date" th:text="${comment.address}">河南</span>
            <a href="" class="ui teal label mine-padded-tiny mine-text-thin"
               th:if="${comment.email}=='18700943190@163.com'"><span>博主</span></a>
            <a href="" class="ui teal label mine-padded-tiny mine-text-thin"
               th:if="${comment.upFlag}==1"><span>置顶</span></a>
        </div>
        <div class="text"><span th:text="${comment.content}">太赞了！</span></div>
        <div class="actions">
            <a class="reply" href="#comment-area" onclick="setTo(this)"
               th:attr="data-toname=${comment.nickName},data-commentid=${comment.id}">回复</a>
        </div>
    </div>
    <div class="comments" th:if="${comment.replays}!=null">
        <div th:unless="${comment.replays}!=null" class="comment" th:replace="this::comment(${comment.replays})">
        </div>
    </div>
</div>


<footer th:fragments="footer" class="ui inverted vertical segment mine-padded-tb-massive">
    <div class="ui center aligned container">
        <div class="ui inverted divided stackable grid">
            <div class="three wide column">
                <h4 class="ui inverted header">关注我</h4>
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/image/gzh.jpg" th:src="@{/image/gzh.jpg}" class="ui rounded image" alt="">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">最新笔记</h4>
                <div class="ui inverted link list mine-opacity-mini">
                    <a th:each="newBlog : ${newBlogs}" href="#" th:href="@{/blog/detail(id=${newBlog.id})}"
                       class="item"><span th:text="${newBlog.title}">用户故事{User Story}</span></a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">联系我</h4>
                <div class="ui inverted link list mine-opacity-mini">
                    <a href="#" class="item">li_xk0225@163.com</a>
                    <a href="#" class="item">1197597322</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted header">笔记信息</h4>
                <div style="text-align:center; display: inline-block">
                    <div class="ui inverted link list mine-opacity-mini" style="text-align: left;">
                        文章总数：<span style="color:orangered;" th:text="${blogTotal}"></span> 篇
                    </div>
                    <div class="ui inverted link list mine-opacity-mini" style="text-align: left;">
                        评论总数：<span style="color:orangered;" th:text="${commentTotal}"></span> 条
                    </div>
                    <div class="ui inverted link list mine-opacity-mini"
                         style="text-align: left;">
                        浏览总数：<span style="color:orangered;" th:text="${pageViewTotal}"></span> 次
                    </div>
                </div>
            </div>
            <div class="four wide column">
                <h4 class="ui inverted header">Blog</h4>
                <p class="mine-opacity-mini" style="text-align: left">
                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    这是我的个人笔记，会分享关于编程、思考相关的内容，希望可以给来到这里的人以帮助......
                </p>
            </div>
        </div>
        <div class="ui inverted section divider"></div>
        <p class="mine-text-thin mine-text-spaced">营业<span id="htmer_time"></span></p>
        <p class="mine-text-thin mine-text-spaced"><a href="http://beian.miit.gov.cn"
                                                      target="_blank">京ICP备20025520号-1</a></p>
    </div>
    <script>
        function secondToDate(second) {
            if (!second) {
                return 0;
            }
            var time = new Array(0, 0, 0, 0, 0);
            if (second >= 365 * 24 * 3600) {
                time[0] = parseInt(second / (365 * 24 * 3600));
                second %= 365 * 24 * 3600;
            }
            if (second >= 24 * 3600) {
                time[1] = parseInt(second / (24 * 3600));
                second %= 24 * 3600;
            }
            if (second >= 3600) {
                time[2] = parseInt(second / 3600);
                second %= 3600;
            }
            if (second >= 60) {
                time[3] = parseInt(second / 60);
                second %= 60;
            }
            if (second > 0) {
                time[4] = second;
            }
            return time;
        }
        function setTime() {
            /*此处为网站的创建时间*/
            var create_time = Math.round(new Date(Date.UTC(2020, 05, 26, 10, 10, 10)).getTime() / 1000);
            var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
            currentTime = secondToDate((timestamp - create_time));
            currentTimeHtml = currentTime[0] + '年' + currentTime[1] + '天'
                + currentTime[2] + '时' + currentTime[3] + '分' + currentTime[4]
                + '秒';
            document.getElementById("htmer_time").innerHTML = currentTimeHtml;
        }
        setInterval(setTime, 1000);
    </script>
</footer>
</body>
</html>








